<?php
 
 class Category_Model_Index extends Zend_Db_Table
{
        protected $_name="category";
        protected $_primary = 'id';
	   
    	
	public function listItem($arrParam = null, $option = null){
		
		$db = Zend_Registry::get('connectDB');				
  		$sql = "select * from category ";
  		$result = $db->fetchAll($sql);
		
  		return $result;
  	}
  	
  	public function getItemByName($name){
  		
  		$db = Zend_Registry::get('connectDB');
  		$sql = "select * from category  where LOWER(name) = '".$name."'";
  		$result = $db->fetchRow($sql);
  		
  		return $result;
  	}
  	
	

}

?>